<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<input type="text" id="y"/>
		<label>年</label>
		<input type="text" id="m"/>
		<label>月</label>
		<input type="text" id="d"/>
		<label>日</label>
		<input type="button" value="确定" onclick="week()"/>
		<h1 id="jg"></h1>
		<script type="text/javascript">
			function week () {
				var y=document.getElementById("y").value;
				var m=document.getElementById("m").value;
				var d=document.getElementById("d").value;
				var days=(y-1900)*365;
				for(var i=1900;i<y;i++){
					if(i%4==0&&i%100!=0||i%400==0)
						days++;
				}
				for(var i=1;i<m;i++){
					switch(i){
						case 2:
							days+=28;
							if(y%4==0&&y%100!=0||y%400==0)
								days++;
							break;
						case 4:
						case 6:
						case 9:
						case 11:
							days+=30;break;
						default:days+=31;
					}
				}
				days+=(d-0);
				var w=days%7;
				var wzh=["星期日","星期一","星期二","星期三","星期四","星期五","星期六"];
				document.getElementById("jg").innerHTML=wzh[w];
			}
		</script>
	</body>
</html>
